package com.cn.sl.server.common.annotation.transaction

import org.springframework.transaction.annotation.Isolation
import org.springframework.transaction.annotation.Propagation
import org.springframework.transaction.annotation.Transactional
import java.sql.SQLException

/**
 * 新建一个独立事务
 *
 * @author 阮雪峰
 */
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
@Transactional(
    propagation = Propagation.REQUIRES_NEW,
    isolation = Isolation.READ_COMMITTED,
    rollbackFor = [Exception::class, RuntimeException::class, SQLException::class]
)
annotation class CommitForPropagationRequiresNew 